#include <REGX52.H>

void delay(unsigned int n) {
	while (n--);
}

void main() {
	unsigned int total = 100;
	int timer, i;
	while (1) {
		for (timer = 0; timer <= total; timer++) {
			for (i = 0; i < 10; i++) {
				P2_0 = 0;
				delay(total - timer);
				P2_0 = 1;
				delay(timer);
			}
		}
	
		for (timer = total; timer >= 0; timer--) {
			for (i = 0; i < 10; i++) {
				P2_0 = 0;
				delay(total - timer);
				P2_0 = 1;
				delay(timer);
			}
		}
	}

}